package com.eqs.enterprisequestionnaire.model.pojo;


import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.*;
import java.time.LocalDateTime;
import java.util.Date;

@TableName("user")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class User {
    private Integer id;//主键

    @NotBlank(message = "用户名不能为空")
    @Size(max = 50, message = "用户名长度不能超过50个字符")
    private String userName;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, max = 20, message = "密码长度在6到20个字符之间")
    private String password;

    @Email(message = "邮箱格式错误")
    @NotEmpty(message = "邮箱为空")
    private String email;

    @NotBlank(message = "性别为空")
    private Boolean gender;
    @NotBlank(message = "无效公司")
    private String enterprise;
    @Size(max = 100, message = "个性签名长度不能超过100个字符")
    private String signature;

    @Past(message = "生日不能是未来的日期")
    private Date birthday;
    private String roleName="默认";
    private LocalDateTime registeredTime;
    private LocalDateTime updatedTime;//也作为上次登录的时间
}
